<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script type="text/javascript">
		function titleCase(str) {
		 var newarr,newarr1=[]; 
		 newarr = str . toLowerCase() . split(" ");
		 for(var i = 0 ; i < newarr . length ; i++){
		 newarr1 . push(newarr[i][0] . toUpperCase()+newarr[i] . substring(1));
		 }
		 return newarr1.join(' ');
		}
		console.log(titleCase("hello world you are me"));

	</script>
	
</body>
</html>